
var fs = require("fs");
var path = require("path");

var readPath = path.join(__dirname, "./from.txt");
var readable = fs.createReadStream(readPath);
var writePath = path.join(__dirname, "/to.txt");
var writable = fs.createWriteStream(writePath);

readable.on("data", function(chunk){
    var chunk1 = chunk.toString();
    var chunk2 = chunk1.toUpperCase();
    writable.write(chunk2);
})
readable.on("end", function(){
    writable.end();
})